/*
 * ThrPool.h
 *
 *  Created on: Apr 19, 2013
 *      Author: travis
 *
 *	Thread pool
 *
 *	Static logic for administration threads in engine.
 *	Based on SDL threads
 *
 */

#pragma once

#ifdef _WIN32 
#include <windows.h> 
#include "SDL_thread.h"
#else
#include "SDL/SDL_thread.h"
#endif

#include "../objects/Objects.h"
#include "../scene/Timer.h"

// count of control check per second
const int CONTROL_PER_SECOND = 30;

namespace ThrPool
{
//The thread for control events
extern SDL_Thread *controlEntityThread;
extern bool quit;
extern bool running;
extern Objects::Objects *objects;

void killEvents();
void quitEntityThread();
bool isRunning();
void setRunning(bool s);

void startControlThread(Objects::Objects *o);

int control(void *data);
}

